* is rendered.
*
* Use gtk_builtin_icon_set_default_size to set a non-zero default
- * size for the icon. If you need to support a legacy size style property,
- * use gtk_builtin_icon_set_default_size_property.
+ * size for the icon.
*
* Themes can override the acutal image that is used with the
* -gtk-icon-source property. If it is not specified, a builtin
return priv->default_size;
}
-
-/**
- * gtk_builtin_icon_set_default_size_property:
- * @icon: icon to set the property for
- * @property_name: Name of the style property
- *
- * Sets the name of a widget style property to use to compute the default size
- * of the icon. If it is set to no %NULL, it will be used instead of the value
- * set via gtk_builtin_icon_set_default_size() to set the default size of the
- * icon.
- *
- * @property_name must refer to a style property that is of integer type.
- *
- * This function is intended strictly for backwards compatibility reasons.
- */
-void
-gtk_builtin_icon_set_default_size_property (GtkBuiltinIcon *icon,
- const char *property_name)
-{
- GtkBuiltinIconPrivate *priv;
-
- g_return_if_fail (GTK_IS_BUILTIN_ICON (icon));
-
- priv = gtk_builtin_icon_get_instance_private (icon);
-
- if (g_strcmp0 (priv->default_size_property, property_name))
- {
- priv->default_size_property = g_strdup (property_name);
- gtk_widget_queue_resize (gtk_css_gadget_get_owner (GTK_CSS_GADGET (icon)));
- }
-}
-
-const char *
-gtk_builtin_icon_get_default_size_property (GtkBuiltinIcon *icon)
-{
- GtkBuiltinIconPrivate *priv;
-
- g_return_val_if_fail (GTK_IS_BUILTIN_ICON (icon), NULL);
-
- priv = gtk_builtin_icon_get_instance_private (icon);
-
- return priv->default_size_property;
-}
void gtk_builtin_icon_set_default_size (GtkBuiltinIcon *icon,
int default_size);
int gtk_builtin_icon_get_default_size (GtkBuiltinIcon *icon);
-void gtk_builtin_icon_set_default_size_property (GtkBuiltinIcon *icon,
- const char *property_name);
-const char * gtk_builtin_icon_get_default_size_property (GtkBuiltinIcon *icon);
G_END_DECLS
container_class->add = gtk_check_button_add;
container_class->remove = gtk_check_button_remove;
- /**
- * GtkCheckButton:indicator-size:
- *
- * The size of the indicator.
- *
- * Deprecated: 3.20: Use CSS min-width and min-height on the indicator node.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("indicator-size",
- P_("Indicator Size"),
- P_("Size of check or radio indicator"),
- 0,
- G_MAXINT,
- INDICATOR_SIZE,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
/**
* GtkCheckButton:indicator-spacing:
*
GTK_WIDGET (check_button),
priv->gadget,
NULL);
- gtk_builtin_icon_set_default_size_property (GTK_BUILTIN_ICON (priv->indicator_gadget), "indicator-size");
gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget), 0, priv->indicator_gadget, FALSE, GTK_ALIGN_BASELINE);
gtk_check_button_update_node_state (GTK_WIDGET (check_button));
FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- /**
- * GtkExpander:expander-size:
- *
- * The size of the expander arrow.
- *
- * Deprecated: 3.20: Use CSS min-width and min-height instead.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("expander-size",
- P_("Expander Size"),
- P_("Size of the expander arrow"),
- 0,
- G_MAXINT,
- DEFAULT_EXPANDER_SIZE,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
/**
* GtkExpander:expander-spacing:
*
priv->title_gadget,
NULL);
gtk_css_gadget_add_class (priv->arrow_gadget, GTK_STYLE_CLASS_HORIZONTAL);
- gtk_builtin_icon_set_default_size_property (GTK_BUILTIN_ICON (priv->arrow_gadget), "expander-size");
gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->title_gadget), -1, priv->arrow_gadget, FALSE, GTK_ALIGN_CENTER);
FALSE,
G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
- /**
- * GtkLevelBar:min-block-height:
- *
- * The min-block-height style property determines the minimum
- * height for blocks filling the #GtkLevelBar widget.
- *
- * Since: 3.6
- *
- * Deprecated: 3.20: Use the standard min-width/min-height CSS properties on
- * the block elements; the value of this style property is ignored.
- */
- gtk_widget_class_install_style_property
- (wclass, g_param_spec_int ("min-block-height",
- P_("Minimum height for filling blocks"),
- P_("Minimum height for blocks that fill the bar"),
- 1, G_MAXINT, DEFAULT_BLOCK_SIZE,
- G_PARAM_READWRITE|G_PARAM_DEPRECATED));
- /**
- * GtkLevelBar:min-block-width:
- *
- * The min-block-width style property determines the minimum
- * width for blocks filling the #GtkLevelBar widget.
- *
- * Since: 3.6
- *
- * Deprecated: 3.20: Use the standard min-width/min-height CSS properties on
- * the block elements; the value of this style property is ignored.
- */
- gtk_widget_class_install_style_property
- (wclass, g_param_spec_int ("min-block-width",
- P_("Minimum width for filling blocks"),
- P_("Minimum width for blocks that fill the bar"),
- 1, G_MAXINT, DEFAULT_BLOCK_SIZE,
- G_PARAM_READWRITE|G_PARAM_DEPRECATED));
-
g_object_class_install_properties (oclass, LAST_PROPERTY, properties);
gtk_widget_class_set_accessible_type (wclass, GTK_TYPE_LEVEL_BAR_ACCESSIBLE);
-1, INT_MAX, -1,
GTK_PARAM_READWRITE));
- /**
- * GtkMenu:arrow-scaling:
- *
- * Arbitrary constant to scale down the size of the scroll arrow.
- *
- * Since: 2.16
- *
- * Deprecated: 3.20: use the standard min-width/min-height CSS properties on
- * the arrow node; the value of this style property is ignored.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_float ("arrow-scaling",
- P_("Arrow Scaling"),
- P_("Arbitrary constant to scale down the size of the scroll arrow"),
- 0.0, 1.0, 0.7,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
binding_set = gtk_binding_set_by_class (class);
gtk_binding_entry_add_signal (binding_set,
GDK_KEY_Up, 0,
10,
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
- /**
- * GtkMenuItem:arrow-scaling:
- *
- * Amount of space used up by the arrow, relative to the menu item's font
- * size.
- *
- * Deprecated: 3.20: use the standard min-width/min-height CSS properties on
- * the arrow node; the value of this style property is ignored.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_float ("arrow-scaling",
- P_("Arrow Scaling"),
- P_("Amount of space used up by arrow, relative to the menu item's font size"),
- 0.0, 2.0, 0.8,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
- /**
- * GtkMenuItem:width-chars:
- *
- * The minimum desired width of the menu item in characters.
- *
- * Since: 2.14
- *
- * Deprecated: 3.20: Use the standard CSS property min-width; the value of
- * this style property is ignored.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("width-chars",
- P_("Width in Characters"),
- P_("The minimum desired width of the menu item in characters"),
- 0, G_MAXINT, 12,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_MENU_ITEM_ACCESSIBLE);
gtk_widget_class_set_css_name (widget_class, "menuitem");
GtkNotebookPrivate *priv = notebook->priv;
gboolean arrow[4];
GtkCssImageBuiltinType up_image_type, down_image_type;
- const char *style_property_name;
GtkCssNode *tabs_node;
gint i;
{
up_image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_UP;
down_image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_DOWN;
- style_property_name = "scroll-arrow-vlength";
}
else
{
up_image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_RIGHT;
down_image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_LEFT;
- style_property_name = "scroll-arrow-hlength";
}
gtk_widget_style_get (GTK_WIDGET (notebook),
else
gtk_builtin_icon_set_image (GTK_BUILTIN_ICON (priv->arrow_gadget[i]), up_image_type);
- gtk_builtin_icon_set_default_size_property (GTK_BUILTIN_ICON (priv->arrow_gadget[i]), style_property_name);
}
else
{
FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- /**
- * GtkPaned::handle-size:
- *
- * The width of the handle.
- *
- * Deprecated: 3.20: Use CSS min-width and min-height instead.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("handle-size",
- P_("Handle Size"),
- P_("Width of handle"),
- 0,
- G_MAXINT,
- 5,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
/**
* GtkPaned:resize:
*
gint baseline,
GtkAllocation *out_clip,
gpointer data);
-static void gtk_progress_bar_measure_trough (GtkCssGadget *gadget,
- GtkOrientation orientation,
- gint for_size,
- gint *minimum,
- gint *natural,
- gint *minimum_baseline,
- gint *natural_baseline,
- gpointer data);
static gboolean gtk_progress_bar_render_trough (GtkCssGadget *gadget,
cairo_t *cr,
gint x,
gint width,
gint height,
gpointer data);
-static void gtk_progress_bar_measure_progress (GtkCssGadget *gadget,
- GtkOrientation orientation,
- gint for_size,
- gint *minimum,
- gint *natural,
- gint *minimum_baseline,
- gint *natural_baseline,
- gpointer data);
static void gtk_progress_bar_measure_text (GtkCssGadget *gadget,
GtkOrientation orientation,
gint for_size,
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, progress_props);
- /**
- * GtkProgressBar:xspacing:
- *
- * Extra spacing applied to the width of a progress bar.
- *
- * Deprecated: 3.20: Use the standard CSS padding and margins; the
- * value of this style property is ignored.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("xspacing",
- P_("X spacing"),
- P_("Extra spacing applied to the width of a progress bar."),
- 0, G_MAXINT, 2,
- G_PARAM_READWRITE|G_PARAM_DEPRECATED));
-
- /**
- * GtkProgressBar:yspacing:
- *
- * Extra spacing applied to the height of a progress bar.
- *
- * Deprecated: 3.20: Use the standard CSS padding and margins; the
- * value of this style property is ignored.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("yspacing",
- P_("Y spacing"),
- P_("Extra spacing applied to the height of a progress bar."),
- 0, G_MAXINT, 2,
- G_PARAM_READWRITE|G_PARAM_DEPRECATED));
-
- /**
- * GtkProgressBar:min-horizontal-bar-width:
- *
- * The minimum horizontal width of the progress bar.
- *
- * Since: 2.14
- *
- * Deprecated: 3.20: Use the standard CSS property min-width.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("min-horizontal-bar-width",
- P_("Minimum horizontal bar width"),
- P_("The minimum horizontal width of the progress bar"),
- 1, G_MAXINT, MIN_HORIZONTAL_BAR_WIDTH,
- G_PARAM_READWRITE|G_PARAM_DEPRECATED));
- /**
- * GtkProgressBar:min-horizontal-bar-height:
- *
- * Minimum horizontal height of the progress bar.
- *
- * Since: 2.14
- *
- * Deprecated: 3.20: Use the standard CSS property min-height.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("min-horizontal-bar-height",
- P_("Minimum horizontal bar height"),
- P_("Minimum horizontal height of the progress bar"),
- 1, G_MAXINT, MIN_HORIZONTAL_BAR_HEIGHT,
- G_PARAM_READWRITE|G_PARAM_DEPRECATED));
- /**
- * GtkProgressBar:min-vertical-bar-width:
- *
- * The minimum vertical width of the progress bar.
- *
- * Since: 2.14
- *
- * Deprecated: 3.20: Use the standard CSS proeprty min-width.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("min-vertical-bar-width",
- P_("Minimum vertical bar width"),
- P_("The minimum vertical width of the progress bar"),
- 1, G_MAXINT, MIN_VERTICAL_BAR_WIDTH,
- G_PARAM_READWRITE|G_PARAM_DEPRECATED));
- /**
- * GtkProgressBar:min-vertical-bar-height:
- *
- * The minimum vertical height of the progress bar.
- *
- * Since: 2.14
- *
- * Deprecated: 3.20: Use the standard CSS property min-height.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("min-vertical-bar-height",
- P_("Minimum vertical bar height"),
- P_("The minimum vertical height of the progress bar"),
- 1, G_MAXINT, MIN_VERTICAL_BAR_HEIGHT,
- G_PARAM_READWRITE|G_PARAM_DEPRECATED));
-
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_PROGRESS_BAR_ACCESSIBLE);
gtk_widget_class_set_css_name (widget_class, "progressbar");
}
GTK_WIDGET (pbar),
priv->gadget,
NULL,
- gtk_progress_bar_measure_trough,
+ NULL,
gtk_progress_bar_allocate_trough,
gtk_progress_bar_render_trough,
NULL,
GTK_WIDGET (pbar),
priv->trough_gadget,
NULL,
- gtk_progress_bar_measure_progress,
+ NULL,
NULL,
NULL,
NULL,
g_object_unref (layout);
}
-static gint
-get_number (GtkCssStyle *style,
- guint property)
-{
- double d = _gtk_css_number_value_get (gtk_css_style_get_value (style, property), 100.0);
-
- if (d < 1)
- return ceil (d);
- else
- return floor (d);
-}
-
-static void
-gtk_progress_bar_measure_trough (GtkCssGadget *gadget,
- GtkOrientation orientation,
- int for_size,
- int *minimum,
- int *natural,
- int *minimum_baseline,
- int *natural_baseline,
- gpointer data)
-{
- GtkWidget *widget;
- GtkProgressBarPrivate *priv;
- GtkCssStyle *style;
-
- widget = gtk_css_gadget_get_owner (gadget);
- priv = GTK_PROGRESS_BAR (widget)->priv;
-
- style = gtk_css_gadget_get_style (gadget);
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- gdouble min_width;
-
- min_width = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MIN_WIDTH), 100.0);
-
- if (min_width > 0.0)
- *minimum = 0;
- else if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_style_get (widget, "min-horizontal-bar-width", minimum, NULL);
- else
- gtk_widget_style_get (widget, "min-vertical-bar-width", minimum, NULL);
- }
- else
- {
- gdouble min_height;
-
- min_height = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MIN_HEIGHT), 100.0);
-
- if (min_height > 0.0)
- *minimum = 0;
- else if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_style_get (widget, "min-horizontal-bar-height", minimum, NULL);
- else
- gtk_widget_style_get (widget, "min-vertical-bar-height", minimum, NULL);
- }
-
- *natural = *minimum;
-
- if (minimum_baseline)
- *minimum_baseline = -1;
- if (natural_baseline)
- *natural_baseline = -1;
-}
-
-static void
-gtk_progress_bar_measure_progress (GtkCssGadget *gadget,
- GtkOrientation orientation,
- int for_size,
- int *minimum,
- int *natural,
- int *minimum_baseline,
- int *natural_baseline,
- gpointer data)
-{
- GtkWidget *widget;
- GtkProgressBar *pbar;
- GtkProgressBarPrivate *priv;
- GtkCssStyle *style;
-
- widget = gtk_css_gadget_get_owner (gadget);
- pbar = GTK_PROGRESS_BAR (widget);
- priv = pbar->priv;
-
- style = gtk_css_gadget_get_style (gadget);
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- gint min_width;
-
- min_width = get_number (style, GTK_CSS_PROPERTY_MIN_WIDTH);
-
- if (min_width != 0)
- *minimum = min_width;
- else if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
- *minimum = 0;
- else
- gtk_widget_style_get (widget, "min-vertical-bar-width", minimum, NULL);
- }
- else
- {
- gint min_height;
-
- min_height = get_number (style, GTK_CSS_PROPERTY_MIN_HEIGHT);
-
- if (min_height != 0)
- *minimum = min_height;
- else if (priv->orientation == GTK_ORIENTATION_VERTICAL)
- *minimum = 0;
- else
- gtk_widget_style_get (widget, "min-horizontal-bar-height", minimum, NULL);
- }
-
- *natural = *minimum;
-
- if (minimum_baseline)
- *minimum_baseline = -1;
- if (natural_baseline)
- *natural_baseline = -1;
-}
-
static void
gtk_progress_bar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
g_object_class_install_properties (gobject_class, LAST_PROP, properties);
- /**
- * GtkRange:slider-width:
- *
- * Width of scrollbar or scale thumb.
- *
- * Deprecated: 3.20: Use the min-height/min-width CSS properties on the
- * slider element. The value of this style property is ignored.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("slider-width",
- P_("Slider Width"),
- P_("Width of scrollbar or scale thumb"),
- 0,
- G_MAXINT,
- 14,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
/**
* GtkRange:trough-border:
*
G_MAXINT,
1,
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
- /**
- * GtkRange:stepper-size:
- *
- * Length of step buttons at ends.
- *
- * Deprecated: 3.20: Use the min-height/min-width CSS properties on the
- * stepper elements. The value of this style property is ignored.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("stepper-size",
- P_("Stepper Size"),
- P_("Length of step buttons at ends"),
- 0,
- G_MAXINT,
- 14,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
/**
* GtkRange:stepper-spacing:
*
TRUE,
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
- /**
- * GtkRange:arrow-scaling:
- *
- * The arrow size proportion relative to the scroll button size.
- *
- * Since: 2.14
- *
- * Deprecated: 3.20: Use min-width/min-height on the "button" node instead.
- * The value of this style property is ignored.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_float ("arrow-scaling",
- P_("Arrow scaling"),
- P_("Arrow scaling with regard to scroll button size"),
- 0.0, 1.0, 0.5,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_RANGE_ACCESSIBLE);
}
PROP_ORIENTATION,
"orientation");
- /**
- * GtkSpinButton:shadow-type:
- *
- * Style of bevel around the sping button.
- *
- * Deprecated: 3.20: Use CSS to determine the style of the border;
- * the value of this style property is ignored.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_enum ("shadow-type",
- P_("Shadow Type"),
- P_("Style of bevel around the spin button"),
- GTK_TYPE_SHADOW_TYPE,
- GTK_SHADOW_IN,
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
/**
* GtkSpinButton::input:
* @spin_button: the object on which the signal was emitted